package com.usian.controller;

import com.usian.pojo.TbItem;
import com.usian.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class CarServiceController {

    @Autowired
    CarService carService;

    @RequestMapping("insertCart")
    public Boolean insertCart(@RequestParam String userId,@RequestBody Map cart){
       return carService.insertCart(userId,cart);
    }

    @RequestMapping("selectCartByUserId")
    public Map<String, TbItem> selectCartByUserId(@RequestParam String userId){
        return carService.selectCartByUserId(userId);
    }

}
